function checkPhoneField(obj_id, required) {
	var isPass = true;
	var this_val = '';
	var areaCode = '';
	if($("#AreaCodeField" + obj_id).length>0){
		areaCode = $("#AreaCodeField" + obj_id + " option:selected").val();
	}
	// for the case: first option is also an area code
	this_val += document.getElementById("Field" + obj_id).value;
	var mobileValue = this_val;
	this_val = this_val.replace('+','');
	var baseMobile = document.getElementById("Field" + obj_id).value;
	var mobileId = $('[name="HiddenFieldID'+obj_id+'"]').val();
	var uniqueCheck = uniqueCheckArr[obj_id];
	if (isEmpty(baseMobile) && required) {
		$('#Field'+obj_id).addClass('errorBorder');
		isPass = false;
		 
		if(errorMsgArr[obj_id]["emptyErrorMsg"]!=''&&errorMsgArr[obj_id]["emptyErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["emptyErrorMsg"].length > 0){
			document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["emptyErrorMsg"];
			globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["emptyErrorMsg"];
		}
		else{
			document.getElementById("ErrMsg" + obj_id).innerHTML = "Please fill in your information";
			globalErrorMessage = globalErrorMessage + "\r\nPlease fill in your Mobile Phone";
		}
		document.getElementById("itemOnPage" + obj_id).style.display = "block";
		if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
		    document.getElementById("ErrMsg" + obj_id).style.display = "block";
	} else if (!isEmpty(baseMobile)) {
		if(isNaN(areaCode)){
			$('#Field'+obj_id).addClass('errorBorder');
			isPass = false;
			 
			if(errorMsgArr[obj_id]["emptyErrorMsg"]!=''&&errorMsgArr[obj_id]["emptyErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["emptyErrorMsg"].length > 0){
				document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["emptyErrorMsg"];
				globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["emptyErrorMsg"];
			}
			else{
				document.getElementById("ErrMsg" + obj_id).innerHTML = "Mobile areacode should be a number";
				globalErrorMessage = globalErrorMessage + "\r\nMobile areacode should be a number";
			}
			document.getElementById("itemOnPage" + obj_id).style.display = "block";
			if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
			    document.getElementById("ErrMsg" + obj_id).style.display = "block";
			return isPass;
		}
		this_val = strReplacement(this_val);
		if (!isNum(this_val)||(baseMobile.length<8)) {
			$('#Field'+obj_id).addClass('errorBorder');
			isPass = false;
			if(errorMsgArr[obj_id]["validErrorMsg"]!=''&&errorMsgArr[obj_id]["validErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["validErrorMsg"].length > 0){
				document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["validErrorMsg"];
				globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["validErrorMsg"];
			}
			else{
				document.getElementById("ErrMsg" + obj_id).innerHTML = "Please enter valid mobile number";
				globalErrorMessage = globalErrorMessage + "\r\nPlease enter valid mobile number";
			}
			document.getElementById("itemOnPage" + obj_id).style.display = "block";
			if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
			    document.getElementById("ErrMsg" + obj_id).style.display = "block";
		}else if((areaCode=='86')&&((baseMobile.length!=11)||(baseMobile.substring(0,1)!=1))){
			$('#Field'+obj_id).addClass('errorBorder');
			isPass = false;
			if(errorMsgArr[obj_id]["validErrorMsg"]!=''&&errorMsgArr[obj_id]["validErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["validErrorMsg"].length > 0){
				document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["validErrorMsg"];
				globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["validErrorMsg"];
			}
			else{
				document.getElementById("ErrMsg" + obj_id).innerHTML = "Please enter valid mobile number";
				globalErrorMessage = globalErrorMessage + "\r\nPlease enter valid mobile number";
			}
			document.getElementById("itemOnPage" + obj_id).style.display = "block";
			if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
			    document.getElementById("ErrMsg" + obj_id).style.display = "block";
		}else if(($.inArray(areaCode,["853"])>-1)&&(($.inArray(baseMobile.substring(0,1),['6'])<0)||(baseMobile.length!=8))){
			$('#Field'+obj_id).addClass('errorBorder');
			isPass = false;
			if(errorMsgArr[obj_id]["validErrorMsg"]!=''&&errorMsgArr[obj_id]["validErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["validErrorMsg"].length > 0){
				document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["validErrorMsg"];
				globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["validErrorMsg"];
			}
			else{
				document.getElementById("ErrMsg" + obj_id).innerHTML = "Please enter valid mobile number";
				globalErrorMessage = globalErrorMessage + "\r\nPlease enter valid mobile number";
			}
			document.getElementById("itemOnPage" + obj_id).style.display = "block";
			if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
			    document.getElementById("ErrMsg" + obj_id).style.display = "block";
		}else if(($.inArray(areaCode,["852"])>-1)&&(($.inArray(baseMobile.substring(0,1),['4','5','6','7','8','9'])<0)||(baseMobile.length!=8))){
			$('#Field'+obj_id).addClass('errorBorder');
			isPass = false;
			if(errorMsgArr[obj_id]["validErrorMsg"]!=''&&errorMsgArr[obj_id]["validErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["validErrorMsg"].length > 0){
				document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["validErrorMsg"];
				globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["validErrorMsg"];
			}
			else{
				document.getElementById("ErrMsg" + obj_id).innerHTML = "Please enter valid mobile number";
				globalErrorMessage = globalErrorMessage + "\r\nPlease enter valid mobile number";
			}
			document.getElementById("itemOnPage" + obj_id).style.display = "block";
			if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
			    document.getElementById("ErrMsg" + obj_id).style.display = "block";
		}else if(($.inArray(areaCode,["886"])>-1)&&(baseMobile.length!=9)){
			$('#Field'+obj_id).addClass('errorBorder');
			isPass = false;
			if(errorMsgArr[obj_id]["validErrorMsg"]!=''&&errorMsgArr[obj_id]["validErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["validErrorMsg"].length > 0){
				document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["validErrorMsg"];
				globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["validErrorMsg"];
			}
			else{
				document.getElementById("ErrMsg" + obj_id).innerHTML = "Please enter valid mobile number";
				globalErrorMessage = globalErrorMessage + "\r\nPlease enter valid mobile number";
			}
			document.getElementById("itemOnPage" + obj_id).style.display = "block";
			if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
			    document.getElementById("ErrMsg" + obj_id).style.display = "block";
		} else if (document.getElementById("Field" + obj_id).maxLength=='8'&&baseMobile.length==8&&$.inArray(baseMobile.substring(0,1),['5','6','9'])<0) { // check mobile validation for max-length = 8 and assume it is hongkong/macau mobile
			$('#Field'+obj_id).addClass('errorBorder');
			isPass = false;
			if(errorMsgArr[obj_id]["validErrorMsg"]!=''&&errorMsgArr[obj_id]["validErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["validErrorMsg"].length > 0){
				document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["validErrorMsg"];
				globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["validErrorMsg"];
			}
			else{
				document.getElementById("ErrMsg" + obj_id).innerHTML = "Please enter valid mobile number";
				globalErrorMessage = globalErrorMessage + "\r\nPlease enter valid mobile number";
			}
			document.getElementById("itemOnPage" + obj_id).style.display = "block";
			if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
			    document.getElementById("ErrMsg" + obj_id).style.display = "block";
		
		}else if(uniqueCheck!=0){
			mobileValue = $.trim(mobileValue);
			if(areaCode !=''){
				mobileValue = areaCode + mobileValue;
			}
			var uniqueResult = uniqueSubmitCheck(mobileId,strReplacement(mobileValue));
			if(!uniqueResult){
				$('#Field'+obj_id).addClass('errorBorder');
				isPass = false;
	//			 
				if(errorMsgArr[obj_id]["uniqueErrorMsg"]!=''&&errorMsgArr[obj_id]["uniqueErrorMsg"]!='undefined'&&errorMsgArr[obj_id]["uniqueErrorMsg"].length > 0){
					document.getElementById("ErrMsg" + obj_id).innerHTML = errorMsgArr[obj_id]["uniqueErrorMsg"];
					globalErrorMessage = globalErrorMessage + "\r\n"+errorMsgArr[obj_id]["uniqueErrorMsg"];
				}
				else{
					document.getElementById("ErrMsg" + obj_id).innerHTML = "One Mobile Phone can only submit once";
					globalErrorMessage = globalErrorMessage + "\r\nOne Mobile Phone can only submit once";
				}
				document.getElementById("itemOnPage" + obj_id).style.display = "block";
				if(errorDisplayWay=='UseRedBoxErrorMessageInWebform')
				    document.getElementById("ErrMsg" + obj_id).style.display = "block";
			} else if (uniqueResult == 'err') {
				isPass = false;
			}
		}		
		
		if(isPass == true && $('#C-Field' + obj_id + '-Confirm').length > 0){
			isPass = confirmMobile(obj_id);
		}
	} 
	if (isPass) {
		document.getElementById("ErrMsg" + obj_id).style.display = "none";
		document.getElementById("ErrMsg" + obj_id).innerHTML = "";
	}
	return isPass;
}